<template>
    <div class="medic_Header">
        <div>
           &nbsp;{{nowTime}}
        </div>
        <div class="medic_Header_title">
社区卫生服务问诊中心
        </div>
        <div> 您好,徐湘江医师</div>
    </div>
    <div class="medic_Contanier">

    </div>
</template>

<script lang="ts" setup>
import {ref} from "vue"
const nowTime = ref('')
    const getNowDate = () =>{
        var myDate = new Date;
        var year = myDate.getFullYear(); //获取当前年
        var mon = myDate.getMonth() + 1; //获取当前月
        var date = myDate.getDate(); //获取当前日
        var hours = myDate.getHours(); //获取当前小时
        var minutes = myDate.getMinutes(); //获取当前分钟
        var seconds = myDate.getSeconds(); //获取当前秒
        nowTime.value = year + "-" + mon + "-" + date + " " + hours + ":" + minutes + ":" + seconds;
    }

    function initRem(){
        var  cw = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
        if(!cw) return;
        var rem = 100 * (cw / 1920);
        document.getElementsByTagName('html')[0].style.fontSize = rem +"px";
        document.getElementsByTagName('html')[0].setAttribute('bili',rem);
    }

    setInterval(getNowDate,50)

    initRem()
</script>

<style scoped>
.medic_Header{
    width: 100%;
    height: 0.5rem;
    background-color: #a3dcfa;
    position: sticky;
    top: 0;
    display: flex;
    font-size: 0.16rem;
    justify-content: space-between;
    align-items: center;
    font-family: fantasy;
}
/*.medic_Header div{*/
/*    flex: 1 1 1;*/
/*}*/
.medic_Header div:first-child{
    padding-left: 0.1rem;
}
    .medic_Contanier{
        /*height: 10.5rem;*/
        /*background-color: ;*/
    }
    .medic_Header_title{
        font-size: 0.3rem;
        font-family: cursive;
    }
</style>